# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=xvidcore

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.3.3
pkgrel=1
pkgdesc="XviD is an open source MPEG-4 video codec (mingw-w64)"
arch=('any')
license=('GPL')
url="http://www.xvid.org/"
options=('strip' '!libtool' 'staticlibs')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-yasm")
source=(http://downloads.xvid.org/downloads/${_realname}-${pkgver}.tar.bz2)
md5sums=('f0a77572ac4694038e8519726b2883d9')

prepare() {
  cd ${srcdir}/${_realname}
}

build() {
  cp -rf ${srcdir}/${_realname} ${srcdir}/build-${MINGW_CHOST}
  cd ${srcdir}/build-${MINGW_CHOST}/build/generic
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST}

  make
}

package() {
  cd ${srcdir}/build-${MINGW_CHOST}/build/generic
  make DESTDIR="${pkgdir}" install
}
